#include <stdio.h>
#include <stdbool.h>
bool IsleapYear(int year)
{
    return ((year%4==0)&&(year%100!=0))||(year%400==0);
}

double CalculateJulianDay(int year,int month,int day,int hour,int minute,double second)
{
    int a=(14-month)/12;
    int y=year+4800-a;
    int m=month+12*a-3;
    double jdn=day+(153*m+2)/5+365*y+y/4;   
    jdn=jdn-y/100+y/400-32045.5;//if(IsGregorianDays(year,month,day))
    return jdn+hour/24.0+minute/1440.0+second/86400.0;
}

int ZellerWeek(int year,int month,int day)
{
    int m=month;
    int d=day;
    if(month<=2)
    {
        year--;
        m=month+12;
    }
    int y=year%100;
    int c=year/100;//centry-1
    int w=(y+y/4+c/4-2*c+(13*(m+1)/5)+d-1)%7;
    if(w<0)w+=7;
    return w;//week
}

int main()
{
    printf("%d\n",(int)CalculateJulianDay(2025,5,14,12,0,0) %7+1);//add 1 to Monday
    printf("%d\n",ZellerWeek(2025,5,14));

    return 0;
}